package com.liu.entity;

import cn.hutool.core.annotation.Alias;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.Date;
import java.io.Serializable;
import java.util.List;

/**
 * (Question)实体类
 *
 * @author makejava
 * @since 2023-02-24 17:25:39
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class Question implements Serializable {
    private static final long serialVersionUID = 100446673613618369L;

    @TableId(type = IdType.AUTO)
    @Alias("ID")
    private Integer id;
    @Alias("用户id")
    private Integer userId;
    private User user;
    @Alias("问题")
    private String problem;
    @Alias("图片")
    private String picture;
    @Alias("时间")
    @JsonSerialize(using = com.liu.entity.DateTime.class)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm")
    private Date time;

    private List<Reply> replyList;
}

